def isin(i,p):
    if p>m:
        print('ok')
        return False
        
    else:
        if a[i]>=b[2*p-1] and a[i]<=b[2*p]:
            return True
        else:
            print('ok')
            return False
            

n=18
m=6
a=[9999,10,20,33,58,46,55,62,69,78,66,57,18,19,16,36,26,5,9]
b=[9999,0,5,10,25,30,70,50,80,5,15,10,20]
c=[0]*(2*m+2)
i=p=1
L=LL=0
while i<=n and p<=m:
    if isin(i,p):
        if isin(i,p+1):
            LL=LL+1
        else:
             L=L+LL+1
             LL=0
        i=i+1
    else:
        c[2*p-1]=L
        c[2*p]=LL
        L=LL=0
        p=p+1
if i<=n:
   c[2*p-1]=n-i+1
else:
    c[2*p-1]=L
    c[2*p]=LL
for i in range(1,2*m+1):
    print(c[i],end="--")
    
